from superdice.libs.diceConfigs import configFile
from superdice.superdice import registerRoll, unregisterRoll

def es_map_start(ev):
    cfgData.execute()

def unload():
    unregisterRoll(diceRoll)

def diceRoll(userid, player, eplayer):
    coloring = map(int, str(rgb).split(','))
    player.setColor(coloring[0], coloring[1], coloring[2])

cfgData = configFile('dice_coloring')
rgb = cfgData.cvar('superdice_cfg_coloring_rgb', '255,105,180', 'What does the player\'s rgb coloring become?')
cfgData.write()
cfgData.execute()

registerRoll(diceRoll, 'coloring')
